<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>出库管理</title>
    <!-- 引入jquery -->
    <script src="/jquery2.2.3/jquery.min.js"></script>
    <!-- 引入layui -->
    <link href="/layui-2.8.17/css/layui.css" rel="stylesheet">
    <script src="/layui-2.8.17/layui.js"></script>
    <!--引入时间搜索框daterangepicker-->
    <link href="/daterangepicker-3.1/daterangepicker.css" rel="stylesheet">
    <script src="/daterangepicker-3.1/moment.min.js"></script>
    <script src="/daterangepicker-3.1/daterangepicker.js"></script>
    <!-- 引入bootstrap -->
    <link href="/bootstrap-3.4.1/css/bootstrap.css" rel="stylesheet">
    <script src="/bootstrap-3.4.1/js/bootstrap.js"></script>
    <!--引入bootstra-table-->
    <link href="/bootstrap-table-1.11.1/bootstrap-table.css" rel="stylesheet">
    <script src="/bootstrap-table-1.11.1/bootstrap-table.js"></script>
    <!-- 引入bootstra-table中文语言包 -->
    <script src="/bootstrap-table-1.11.1/locale/bootstrap-table-zh-CN.js"></script>
    <!--引入bootstrap-select-->
    <link href="/bootstrap-select-1.13.0/dist/css/bootstrap-select.min.css" rel="stylesheet">
    <script src="/bootstrap-select-1.13.0/js/bootstrap-select.js"></script>
</head>
<body>
<div class="container-fluid">
    <div class="top-toolbar" id="top-toolbar">
        <div class="form-group">
            <label for="search-goodsName" class="col-sm-2 control-label">商品名称</label>
            <div class="col-sm-4">
                <input type="text" id="search-goodsName" name="search-goodsName" class="form-control well"/>
            </div>
        </div>
        <div class="form-group">
            <label for="search-shopName" class="col-sm-2 control-label">店铺名称</label>
            <div class="col-sm-4">
                <input type="text" id="search-shopName" name="search-shopName" class="form-control well"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="search-no">出库编号</label>
            <div class="col-sm-4">
                <input class="form-control well" id="search-no" name="search-no" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label for="search-startAndEndTime" class="col-sm-2 control-label">出库时间</label>
            <div class="col-sm-4">
                <input type="text" id="search-startAndEndTime" name="search-startAndEndTime" class="form-control well"/>
            </div>
        </div>

        <!--第一个selectpicker 无法打开下拉框？-->
        <div class="form-group" style="display: none">
            <select id="search-inOutType" class="col-sm-2 selectpicker">
            </select>
        </div>

        <div class="form-group">
            <label for="search-verifiedType" class="col-sm-2 control-label">是否核销</label>
            <select id="search-verifiedType" class="col-sm-2 selectpicker">
                <option value="" selected>全部</option>
                <option value="0">未核销</option>
                <option value="1">已核销</option>
            </select>
        </div>

        <div>
            <button class="btn btn-primary" id="searchOutbound" onclick="searchOutboundOnClick()">查询</button>
            <button type="button" id="reset" class="btn btn-default">重置</button>
            <button class="btn btn-info" data-toggle="modal" data-target="#addModal">新增</button>
            <button type="button" id="batchVerified" class="btn btn-default">批量核销</button>
            <button type="button" id="batchDelete" class="btn btn-default">批量删除</button>
        </div>
    </div>
    <br>

    <!--  定义添加模态框触发器，此处为按钮触发  -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->

                <div class="btn-info modal-header">
                    <!--  模态框标题  -->
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <!--  关闭按钮  -->
                    <h4>新增出库</h4>
                    <!--  标题内容  -->
                </div>

                <div class="modal-body">
                    <div>
                        <div class="form-group">
                            <label for="add-all-shopId" class="col-sm-2 control-label">店铺id</label>
                            <div class="col-sm-9">
                                <input type="text" id="add-all-shopId" name="add-all-shopId"
                                       class="form-control well"
                                       disabled/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="add-all-shopName" class="col-sm-2 control-label">店铺名称</label>
                            <div class="col-sm-9">
                                <input type="text" id="add-all-shopName" name="add-all-shopName"
                                       class="form-control well dropdown-menu-input" autocomplete="off"/>
                                <ul class="dropdown-menu pre-scrollable" id="all-add-shop-dropdown-menu"></ul>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="add-all-note" class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-9">
                                <input type="text" id="add-all-note" name="add-all-note" class="form-control well"/>
                            </div>
                        </div>
                    </div>


                    <div id="addTrDiv" style="margin-top:30px; width: 15%; float: right;">
                        <button type="button" class="btn btn-info" onclick="addTr()">添加一行</button>
                    </div>
                    <table class="table table-bordered" id="addGoodsTable">
                        <thead>
                        <tr>
                            <th style="text-align:center">商品id</th>
                            <th style="text-align:center">商品名称</th>
                            <th style="text-align:center">盒装数量</th>
                            <th style="text-align:center">散装数量</th>
                            <th style="text-align:center">规格</th>
                            <th style="text-align:center">店铺id</th>
                            <th style="text-align:center">店铺名称</th>
                            <th style="text-align:center">备注</th>
                            <th style="text-align:center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <!--商品id-->
                            <td style="text-align:center" name="goodsId" disabled></td>
                            <!--商品名称-->
                            <td style="text-align:center" name="goodsName" onclick="tdClick(this)"
                                autocomplete="off"></td>
                            <!--盒装数量-->
                            <td onclick="tdClick(this)" style="text-align:center" name="boxNum"
                                oninput="boxNumInput(this)"></td>
                            <!--数量-->
                            <td onclick="tdClick(this)" style="text-align:center" name="num"
                                oninput="numInput(this)"></td>
                            <!--规格-->
                            <td disabled onclick="tdClick(this)" style="text-align:center" name="perBox"></td>
                            <!--店铺id-->
                            <td style="text-align:center" name="shopId" disabled></td>
                            <!--规格-->
                            <td style="text-align:center" name="shopName" onclick="tdClick(this)"
                                autocomplete="off"></td>
                            <!--备注-->
                            <td style="text-align:center" name="note" onclick="tdClick(this)"></td>
                            <!--操作-->
                            <td style="text-align:center; " onclick="trDelete(this)">
                                <button type="button" class="btn btn-xs btn-link">删除</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                </div>

                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button type="button" id="addOutbound" class="btn btn-info">新增</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#addModal -->

    <!--  定义修改模态框触发器，此处为按钮触发  -->
    <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->

                <div class="btn-info modal-header">
                    <!--  模态框标题  -->
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <!--  关闭按钮  -->
                    <h4>修改出库</h4>
                    <!--  标题内容  -->
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label for="update-id" class="col-sm-2 control-label">出库id</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-id" name="update-id" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-no" class="col-sm-2 control-label">出库编号</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-no" name="update-no" class="form-control well"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-goodsId" class="col-sm-2 control-label">商品id</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-goodsId" name="update-goodsId" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-goodsName" class="col-sm-2 control-label">商品名称</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-goodsName" name="update-goodsName" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-num" class="col-sm-2 control-label">出库数量</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-num" name="update-num" class="form-control well"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-shopId" class="col-sm-2 control-label">店铺id</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-shopId" name="update-shopId" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-shopName" class="col-sm-2 control-label">店铺名称</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-shopName" name="update-shopName"
                                   class="form-control well dropdown-menu-input" autocomplete="off"/>
                            <ul class="dropdown-menu pre-scrollable" id="update-shop-dropdown-menu"></ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="update-note" class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-9">
                            <input type="text" id="update-note" name="update-note" class="form-control well"/>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button type="button" id="updateOutbound" class="btn btn-info">修改</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#updateModal -->

    <!--  定义删除模态框触发器，此处为按钮触发  -->
    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->

                <div class="btn-info modal-header">
                    <!--  模态框标题  -->
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <!--  关闭按钮  -->
                    <h4>删除出库</h4>
                    <!--  标题内容  -->
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label for="delete-id" class="col-sm-2 control-label">出库id</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-id" name="delete-id" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-no" class="col-sm-2 control-label">出库编号</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-no" name="delete-no" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-goodsId" class="col-sm-2 control-label">商品id</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-goodsId" name="delete-goodsId" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-goodsName" class="col-sm-2 control-label">商品名称</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-goodsName" name="delete-goodsName" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-shopId" class="col-sm-2 control-label">店铺id</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-shopId" name="delete-shopId" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-shopName" class="col-sm-2 control-label">店铺名称</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-shopName" name="delete-shopName"
                                   class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="delete-note" class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-9">
                            <input type="text" id="delete-note" name="delete-note" class="form-control well" disabled/>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button type="button" id="deleteOutbound" class="btn btn-danger">删除</button>
                    <button type="button" class="btn btn-info" data-dismiss="modal">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#deleteModal -->

    <table class="table table-bordered" id="outbound"></table>
</div>

<script src="/js/outbound.js"></script>
</body>

</html>